<template>
  <div class="orderGoods">
    <!-- <div class="total">共{{ cartInfo.length }}件商品</div> -->
    <div class="goodWrapper" :class="{ ishavebottom: type == '0' }">
      <div v-for="cart in cartInfo" :key="cart.id">
        <div class="item acea-row row-between-wrapper">
          <div class="pictrue">
            <img :src="cart.productInfo.image" class="image" />
          </div>
          <div class="text">
            <div class="acea-row row-between-wrapper">
              <div
                class="name line1"
                style="font-weight:400;color:rgba(0,0,0,1);font-size:0.26rem;"
              >
                {{ cart.productInfo.store_name }}
              </div>
              <!-- <div class="num">x {{ cart.cart_num }}</div> -->
            </div>
            <div
              class="attr line1"
              v-if="cart.productInfo.attrInfo && cart.is_virtual == 0"
              style="font-size:0.24rem;font-weight:400;color:rgba(0,0,0,.5);margin-top:0.14rem;"
            >
              {{ cart.productInfo.attrInfo.suk }}
            </div>
            <div class="money font-color-red" style="margin:0.2rem 0 0.26rem;">
              <template v-if="cart.is_virtual == 0">
                <span
                  v-show="cart.productInfo.is_seven_returned == 1"
                  class="cantui"
                  >7天无理由退换货</span
                >
                <span
                  v-show="cart.productInfo.is_seven_returned == 0"
                  class="cantui"
                  >不支持7天无理由退货</span
                >
              </template>
              <span v-if="cart.is_virtual == 1" class="cantui">虚拟商品</span>
              <!-- <span v-show="type == '0'" class="num">12312件</span>
              <span v-show="type == '0'" class="have">剩余</span> -->
              <span v-if="cart.is_virtual == 0" class="price"
                >￥{{ cart.productInfo.price }}</span
              >
            </div>
            <!-- <div
              class="evaluate"
              v-if="evaluate === 3"
              @click="$router.push({ path: '/goods_evaluate/' + cart.unique })"
            >
              评价
            </div> -->
          </div>
        </div>
        <div
          class="item acea-row row-between-wrapper numDiv"
          v-show="
            cartInfo.isVirtual == '1' && cart.is_virtual == 1
              ? true
              : cartInfo.length > 1
              ? true
              : false
          "
          :class="cartInfo.isVirtual == '1' ? 'isVirtual' : ''"
        >
          <div class="title">购买数量</div>
          <div class="carnum acea-row row-center-wrapper">
            <!-- :class="cartList.valid[index].cart_num <= 1 ? 'on' : ''" -->
            <!-- <div
                  class="reduce"
                  
                  @click.prevent="reduce(index)"
                >
                  -
                </div> -->
            <div class="num">
              <!-- v-model="item.cart_num" -->
              <!-- <input
                    type="number"
                    :value="cart.cart_num"
                    class="ipt_num"
                    @input.prevent="specifiName(index)"
                    @blur.prevent="blurName(index)"
                  /> -->
              x {{ cart.cart_num }}
            </div>

            <!-- <div
                  class="plus"
                  
                  @click.prevent="plus(index)"
                >
                  +
                </div> -->
            <!-- <div
                  class="plus"
                  v-else
                  :class="
                    cartList.valid[index].cart_num >= cartList.valid[index].stock
                      ? 'on'
                      : ''
                  "
                  @click.prevent="plus(index)"
                >
                  +
                </div> -->
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "OrderGoods",
  props: {
    type: Number,
    evaluate: Number,
    cartInfo: {
      type: Array,
      default: () => []
    }
  },
  data: function() {
    return {};
  },
  mounted: function() {},
  methods: {},
  created() {
    console.log(this.type);
  }
};
</script>
<style scoped>
.ishavebottom {
  margin-bottom: 0.2rem;
}
.item .carnum {
  height: 0.44rem;
  position: absolute;
  right: 0rem;
}
.item .carnum div {
  width: 0.4rem;
  text-align: right;
  height: 100%;
  line-height: 0.4rem;
  font-size: 0.32rem;
  color: #a4a4a4;
}
.item .carnum .reduce {
  border-right: 0;
  border-radius: 0.03rem 0 0 0.03rem;
}
.item .carnum .reduce.on {
  border-color: #e3e3e3;
  color: #dedede;
  margin-right: 0.02rem;
}
.item .carnum .plus {
  border-left: 0;
  border-radius: 0 0.03rem 0.03rem 0;
  background: rgba(245, 245, 245, 1);
}
.item .carnum .num {
  color: #282828;
  width: 0.88rem;
  margin-right: 0.02rem;
}
.item .carnum .num input {
  width: 100%;
  display: block;
  text-align: right;
  line-height: 0.45rem;
}
.numDiv {
  border-bottom: 0.02rem solid rgba(0, 0, 0, 0.08);
  /* padding-bottom: .34rem; */
}
.isVirtual {
  border-bottom: none;
}
/* .numDiv:last-of-type {
  border-bottom: none;
} */
/* background: rgba(245, 245, 245, 1); */
</style>
